/*
 * @Description:
 * @Author: Cxy
 * @Date: 2023-04-24 16:43:14
 * @LastEditors: Cxy
 * @LastEditTime: 2024-03-14 10:43:30
 * @FilePath: \blogAdmin\play\src\router\model\menu.ts
 */
import type { RouteConfigInter } from '../type'

export default {
  path: '/menu',
  meta: {
    icon: 'material-symbols:format-list-numbered',
    title: 'menus.menuMore'
  },
  children: [
    {
      /* 路由可以简写，会自动补全，切记当简写时不能以“/”开头 */
      path: 'menu-1',
      meta: {
        icon: 'ep/switch-filled',
        title: 'menus.menu-1',
        /* 组件缓存直接加此字段，不需要给组件起名字，程序会自动添加，设置为true自动缓存 */
        keepAlive: true
      },
      component: () => import('@/views/menu/index.vue')
    },
    {
      path: '/menu/menu-2',
      meta: {
        icon: 'ep/switch-filled',
        title: 'menus.menu-2'
      },
      children: [
        {
          // https://router.vuejs.org/zh/guide/essentials/dynamic-matching.html#%E5%B8%A6%E5%8F%82%E6%95%B0%E7%9A%84%E5%8A%A8%E6%80%81%E8%B7%AF%E7%94%B1%E5%8C%B9%E9%85%8D
          /* 动态路由传参参考，只支持最后的路由传参，支持任意多个 */
          path: 'menu-2-1/:id?/:aaa?',
          meta: {
            title: 'menus.menu-2-1'
          },
          component: () => import('@/views/menu/index.vue')
        },
        {
          path: 'menu-2-2',
          meta: {
            title: 'menus.menu-2-2'
          },
          children: [
            {
              path: 'menu-2-2-1',
              meta: {
                title: 'menus.menu-2-2-1',
                keepAlive: true
              },
              component: () => import('@/views/menu/index.vue')
            },
            {
              path: 'menu-2-2-2',
              meta: {
                title: 'menus.menu-2-2-2',
                keepAlive: true
              },
              component: () => import('@/views/menu/index.vue')
            }
          ]
        }
      ]
    },
    {
      path: 'menu-3',
      meta: {
        icon: 'ep/switch-filled',
        title: 'menus.menu-3',
        keepAlive: true
      },
      component: () => import('@/views/menu/index.vue')
    }
  ]
} as RouteConfigInter
